<?php
class categoryController extends adminController{

    // 分类首页
    public function index()
    {
        $this->model_list=model('model_manage')->model_list();
        $this->list=model('category')->category_list();
        $this->show();
    }

    public function ajax_edit(){
        if(empty($_POST['element_id'])){
            echo $_POST['original_value'];
            exit;
        }
        $array=explode('_', $_POST['element_id']);
        $name=$array[0];
        $cid=$array[1];
        if(empty($name)||empty($cid)){
            echo $_POST['original_value'];
            exit;
        }
        if(model('category')->ajax_edit($cid,$name,$_POST['update_value'])){
            echo $_POST['update_value'];
        }else{
            echo $_POST['original_value'];
        }
    }



}

?>